/* contains the javascript for the custom popup list */

function add_collection()
{
	// loop though the inputs and get the ids of the entire list
	var ids = '';
	inputs = document.getElementsByTagName('input');
	for(i = 0; i < inputs.length; i++) {
		if(inputs.item(i).name == 'id[]') {
			// id found
			ids += '&id[]='+inputs.item(i).value;
		}
	}
	if(ids != '') {
		opener.document.location.href = 'index.php?what=mymovies&do=add'+ids;
		close_window();
	} else {
		alert('No movies are currently in your selection!');
	}
}

function close_window()
{
	window.close();
}